I just googled the escape sequence and fixed that. Here is the function that appears to be causing the problem
Code:
void find_subrec(FILE* ifp, FILE* ofp, char* line)
{
char* subrec = "STARTSUBRECORD: IVSUBREC";
char* partnum = "PARTNUMB:";
char* temp = malloc_array(STR);
fgets( temp, 50, ifp);
while( (strncmp( temp, subrec, 24) != 0) && (strncmp( temp, partnum, 9) != 0 ) )
fgets( temp, 50, ifp);
while( (strncmp( temp, subrec, 24) != 0) && (strncmp( temp, partnum, 9) == 0 ) )
{
fprintf( ofp, "%s\n", line);
printf("line to file\n");
free(temp);
line = clear_array(line, LINE);
return;
}
free(temp);
sort_vendor(ifp, ofp, line);
return;
}
What I am trying to do is read through the file for lines marked like VENDOR: and PARTNUMB: then copy those lines to a string with no newline characters so when it gets printed in the new file all the information is in neat columns that I can open in excel. The system the information is coming out of wont export to spreadsheet, only to text files.